﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace TimeTracker
{
    /// <summary>
    /// Describes a provider
    /// </summary>
    public interface IProvider
    {
        IEnumerable<IProject> GetProjects();

        IProject CreateProject(IProject parentProject, string name);

        ISession CreateSession(IProject project, DateTime start, DateTime? end);

        INote CreateNote(ISession session, DateTime time, string text);

        void RemoveProject(IProject project);
        void RemoveSession(ISession session);
        void RemoveNote(INote note);

        XmlDocument GetXmlDocument();

        void Save();

        //permissions
        bool CanCreateProject(IProject parent);
        bool CanEditProject(IProject project);
        bool CanDeleteProject(IProject project);

        bool CanCreateSession(IProject project);
        bool CanEditSession(ISession session);
        bool CanDeleteSession(ISession session);

        bool CanCreateNote(ISession session);
        bool CanEditNote(INote note);
        bool CanDeleteNote(INote note);
    }
}
